﻿<UserControl x:Class="EpiDashboard.DashboardControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dashboard="clr-namespace:EpiDashboard"
    xmlns:Controls="clr-namespace:EpiDashboard.Controls"
    Height="700" Width="900" Background="White">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="ResourceDictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    
    <Grid x:Name="grdMain">
        <Grid.RowDefinitions>
            <RowDefinition Height="32"></RowDefinition>
            <RowDefinition Height="5"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="1"></RowDefinition>
            <RowDefinition Height="1"></RowDefinition>
            <RowDefinition Height="20"></RowDefinition>
        </Grid.RowDefinitions>

        <!--<DockPanel Grid.Row="1" Background="#CBCFD4"></DockPanel>-->

        <Controls:GadgetInfoPanel x:Name="infoPanel" Grid.Row="2" Margin="4" Visibility="Collapsed" />
        
        <DockPanel SnapsToDevicePixels="True" Grid.Row="0">
            <Grid>
                <Rectangle Style="{DynamicResource shadowRectangle}"></Rectangle>
                <DockPanel Background="{DynamicResource menuBarBackground}">
                    <Grid x:Name="grdMenuBarInner">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="12"></ColumnDefinition>
                            <ColumnDefinition Width="45" />
                            <ColumnDefinition Width="15" />
                            <ColumnDefinition Width="Auto" MinWidth="130" />
                            <ColumnDefinition Width="Auto" MinWidth="75" />
                            <ColumnDefinition Width="Auto" MinWidth="75" />
                            <ColumnDefinition Width="Auto" MinWidth="90" />
                            <ColumnDefinition Width=".05*" MaxWidth="32" />
                            <ColumnDefinition Width="2" />
                            <ColumnDefinition Width=".05*" MaxWidth="32" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width=".9*" />
                        </Grid.ColumnDefinitions>
                        <TextBlock x:Name="tblockSetDataSource" Foreground="White" Grid.Column="3" FontWeight="Light" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0" MouseEnter="tblockSetDataSource_MouseEnter" MouseLeave="tblockSetDataSource_MouseLeave" MouseLeftButtonDown="tblockSetDataSource_MouseLeftButtonDown" MouseLeftButtonUp="tblockSetDataSource_MouseLeftButtonUp" Text="Set Data Source">
                            <TextBlock.ToolTip>
                                <StackPanel>
                                    <Label x:Name="tooltipSetDataSourceHeader" FontWeight="Bold">Set Data Source Button</Label>
                                    <TextBlock x:Name="tooltipSetDataSource"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Attaches a data source (Epi Info 7 project, Excel spreadsheet, etc.) to a new, blank Dashboard canvas.</TextBlock>
                                </StackPanel>
                                <!--<ToolTip>
                                    <TextBlock x:Name="tooltipSetDataSource">Attaches a data source (Epi Info 7 project, Excel spreadsheet, etc.) to a new, blank Dashboard canvas.</TextBlock>
                                </ToolTip>-->
                            </TextBlock.ToolTip>
                        </TextBlock>
                        <TextBlock x:Name="tblockOpen" Foreground="White" Grid.Column="4" FontWeight="Light" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0" MouseEnter="tblockOpen_MouseEnter" MouseLeave="tblockOpen_MouseLeave" MouseLeftButtonDown="tblockOpen_MouseLeftButtonDown" MouseLeftButtonUp="tblockOpen_MouseLeftButtonUp" Text="Open">
                            <TextBlock.ToolTip>
                                <StackPanel>
                                    <Label x:Name="tooltipOpenHeader" FontWeight="Bold">Open Button</Label>
                                    <TextBlock x:Name="tooltipOpen"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Opens an existing Dashboard canvas file.
                                    </TextBlock>
                                </StackPanel>
                                <!--<ToolTip>
                                    <TextBlock x:Name="tooltipOpen">Opens an existing Dashboard canvas file.</TextBlock>
                                </ToolTip>-->
                            </TextBlock.ToolTip>
                        </TextBlock>
                        <TextBlock x:Name="tblockSave" Foreground="White" Grid.Column="5" FontWeight="Light" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0" MouseEnter="tblockSave_MouseEnter" MouseLeave="tblockSave_MouseLeave" MouseLeftButtonDown="tblockSave_MouseLeftButtonDown" MouseLeftButtonUp="tblockSave_MouseLeftButtonUp" Text="Save">
                            <TextBlock.ToolTip>
                                <StackPanel>
                                    <Label x:Name="tooltipSaveHeader" FontWeight="Bold">Save Button</Label>
                                    <TextBlock x:Name="tooltipSave"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Saves the current Dashboard canvas.
                                    </TextBlock>
                                </StackPanel>
                                <!--<ToolTip>
                                    <TextBlock x:Name="tooltipSave">Saves the current Dashboard canvas.</TextBlock>
                                </ToolTip>-->
                            </TextBlock.ToolTip>
                        </TextBlock>
                        <TextBlock x:Name="tblockSaveAs" Foreground="White" Grid.Column="6" FontWeight="Light" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0" MouseEnter="tblockSaveAs_MouseEnter" MouseLeave="tblockSaveAs_MouseLeave" MouseLeftButtonDown="tblockSaveAs_MouseLeftButtonDown" MouseLeftButtonUp="tblockSaveAs_MouseLeftButtonUp" Text="Save as">
                            <TextBlock.ToolTip>
                                <StackPanel>
                                    <Label x:Name="tooltipSaveAsHeader" FontWeight="Bold">Save As Button</Label>
                                    <TextBlock x:Name="tooltipSaveAs"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Saves the current Dashboard canvas to a different file.
                                    </TextBlock>
                                </StackPanel>
                                <!--<ToolTip>
                                    <TextBlock x:Name="tooltipSaveAs">Saves the current Dashboard canvas to a different file.</TextBlock>
                                </ToolTip>-->
                            </TextBlock.ToolTip>
                        </TextBlock>

                        <DockPanel x:Name="whiteUnderlineRefresh" Background="White" Height="3" VerticalAlignment="Bottom"  Grid.Column="1" Visibility="Collapsed"></DockPanel>
                        <DockPanel x:Name="whiteUnderlineSetData" Background="White" Width="{Binding ElementName=tblockSetDataSource, Path=ActualWidth}" Height="3" VerticalAlignment="Bottom"  Grid.Column="3" Visibility="Collapsed"></DockPanel>
                        <DockPanel x:Name="whiteUnderlineOpen" Background="White" Width="{Binding ElementName=tblockOpen, Path=ActualWidth}" Height="3" VerticalAlignment="Bottom"  Grid.Column="4" Visibility="Collapsed"></DockPanel>
                        <DockPanel x:Name="whiteUnderlineSave" Background="White" Width="{Binding ElementName=tblockSave, Path=ActualWidth}" Height="3" VerticalAlignment="Bottom"  Grid.Column="5" Visibility="Collapsed"></DockPanel>
                        <DockPanel x:Name="whiteUnderlineSaveAs" Background="White" Width="{Binding ElementName=tblockSaveAs, Path=ActualWidth}" Height="3" VerticalAlignment="Bottom"  Grid.Column="6" Visibility="Collapsed"></DockPanel>

                        <DockPanel x:Name="iconRefresh" VerticalAlignment="Center" HorizontalAlignment="Center" Background="Transparent" Grid.Column="1" IsHitTestVisible="True" MouseEnter="iconRefresh_MouseEnter" MouseLeave="iconRefresh_MouseLeave" MouseLeftButtonUp="iconRefresh_MouseLeftButtonUp" MouseLeftButtonDown="iconRefresh_MouseLeftButtonDown">
                            <DockPanel.ToolTip>
                                <StackPanel>
                                    <Label x:Name="tooltipRefreshHeader" FontWeight="Bold">Refresh Button</Label>
                                    <TextBlock x:Name="tooltipRefresh"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Re-connects to the data source and downloads the latest available data.</TextBlock>
                                </StackPanel>
                            </DockPanel.ToolTip>
                            <Path x:Name="pathRefresh" Fill="White" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Center" >
                                <Path.Data>
                                    <PathGeometry x:Name="menuBarRefreshIcon" FillRule="Nonzero" Figures="M17.7069606781006,0L17.7069606781006,7.08894014358521 10.6178398132324,7.08894014358521 10.6178398132324,6.92316055297852 10.7008209228516,7.00614023208618 13.2701406478882,4.43699979782104C12.1156206130981,3.3539400100708 10.5647401809692,2.68830013275146 8.86068058013916,2.68830037117004 5.30388021469116,2.68830013275146 2.41020011901855,5.58215999603271 2.41020011901855,9.13878059387207 2.41020011901855,12.6959400177002 5.30388021469116,15.5894412994385 8.86068058013916,15.5894412994385 10.6392602920532,15.5894412994385 12.2520608901978,14.8661994934082 13.4200801849365,13.6979999542236L15.1234197616577,15.4017009735107C13.5190811157227,17.0062198638916 11.3041801452637,18 8.86086082458496,18 3.97494029998779,18 0,14.0250606536865 2.98023223876953E-08,9.13878059387207 0,4.2530403137207 3.97494029998779,0.27810001373291 8.86086082458496,0.27810001373291 11.2293004989624,0.27810001373291 13.3819208145142,1.21410000324249 14.9732999801636,2.73330020904541L17.7069606781006,0z" />
                                </Path.Data>
                            </Path>
                        </DockPanel>

                        <Border x:Name="borderDataSource" Visibility="Collapsed" Grid.Column="10" Grid.ColumnSpan="3" CornerRadius="6" BorderThickness="1" BorderBrush="#53A7D9" Margin="0, 3, 0, 3"></Border>

                        <TextBlock x:Name="tblockDataSourceLabel" Visibility="Collapsed" Foreground="White" Grid.Column="10" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="11,0,2,0"><Bold>Data Source:</Bold></TextBlock>
                        <TextBlock x:Name="tblockDataSource" Visibility="Collapsed" Foreground="White" Grid.Column="11" FontWeight="Light" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="2,0,11,0">E. Coli / FoodHistory
                            <TextBlock.ToolTip>
                                <ToolTip>
                                    <TextBlock x:Name="tooltipDataSourceLabel"></TextBlock>
                                </ToolTip>
                            </TextBlock.ToolTip>
                        </TextBlock>
                        <TextBlock x:Name="tblockRecordCount" Visibility="Collapsed" Foreground="White" Grid.Column="12" FontWeight="Light" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="11,0,11,0">(359 records)</TextBlock>
                    </Grid>                    
                </DockPanel>
            </Grid>
        </DockPanel>        
        
        <Controls:NotificationPanel Visibility="Visible" IsHitTestVisible="False" x:Name="panelNotification" Grid.Row="3" Height="52" MinWidth="720" VerticalAlignment="Bottom"></Controls:NotificationPanel>               

        <Image Margin="0, 10, 30, 0" Opacity="0.15" Width="79" Height="77" Source="Images/watermark_logo.png" Visibility="Visible" IsHitTestVisible="False" x:Name="imageWatermark" Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Top"/>

        <ScrollViewer Grid.Row="3" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True" x:Name="scrollViewer">
            <ScrollViewer.ContextMenu>
                <ContextMenu>
                    <MenuItem x:Name="mnuDataSource" Header="Set data source...">
                        <MenuItem.Icon>
                            <Image Source="Images/db_add.png" Stretch="Fill" Height="16px" Width="16px" />
                        </MenuItem.Icon>
                    </MenuItem>                    
                    <MenuItem x:Name="mnuAddRelatedData" Header="Add related data source..." />
                    <MenuItem x:Name="mnuOpen" Header="Open canvas..." />
                    <MenuItem x:Name="mnuSave" Header="Save canvas" />
                    <MenuItem x:Name="mnuSaveAs" Header="Save canvas as..." />
                    <Separator/>
                    <MenuItem x:Name="mnuSaveOutput" Header="Save output as HTML">
                        <MenuItem.Icon>
                            <Image Source="Images/saveHTML.png" Stretch="Fill" Height="16px" Width="16px" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem x:Name="mnuSendOutputTo" Header="Send output to" IsEnabled="False">
                        <MenuItem x:Name="mnuSendOutputToExcel" Header="Microsoft Excel" IsEnabled="False" />
                        <MenuItem x:Name="mnuSendOutputToWord" Header="Microsoft Word" IsEnabled="False" />
                    </MenuItem>
                    <MenuItem x:Name="mnuExport" Header="Export data" IsEnabled="False" />
                    <Separator/>
                    <MenuItem x:Name="mnuAddGadget" Header="Add Analysis Gadget">
                        <MenuItem.Icon>
                            <Image Source="Images/gadget.png" Stretch="None" />
                        </MenuItem.Icon>
                        <Controls:GadgetMenuItem x:Name="mnuLineList" Header="Line list" GadgetType="EpiDashboard.LineListControl" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuFrequency" Header="Frequency" GadgetType="EpiDashboard.FrequencyControl" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuWordCloud" Header="Word cloud" GadgetType="EpiDashboard.WordCloudControl" Click="mnuGadgetMenuItem_Click" />
                        <!--<Controls:GadgetMenuItem x:Name="mnuAberration" Header="Aberration Detection" GadgetType="EpiDashboard.AberrationControl" Click="mnuGadgetMenuItem_Click" />-->
                        <Controls:GadgetMenuItem x:Name="mnuCombinedFrequency" Header="Combined frequency" GadgetType="EpiDashboard.CombinedFrequencyControl" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnu2x2" Header="2 x 2 Table" Visibility="Collapsed" GadgetType="EpiDashboard.CrosstabControl" Click="mnuGadgetMenuItem_Click"  />
                        <Controls:GadgetMenuItem x:Name="mnuMxN" Header="M x N / 2 x 2 Table" IsEnabled="True" GadgetType="EpiDashboard.CrosstabControl" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuPMCC" Header="Matched pair case-control" IsEnabled="True" GadgetType="EpiDashboard.PMCCControl" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuMeans" Header="Means" GadgetType="EpiDashboard.MeansControl" Click="mnuGadgetMenuItem_Click" />
                        <!--<Controls:GadgetMenuItem x:Name="mnuChart" Header="Chart" GadgetType="EpiDashboard.ChartControl" Click="mnuGadgetMenuItem_Click" />-->
                        <!--<Controls:GadgetMenuItem x:Name="mnuDeduplication" Header="Deduplication" GadgetType="EpiDashboard.DeduplicationControl" Click="mnuGadgetMenuItem_Click" />-->
                        <MenuItem x:Name="mnuCharts"  Header="Charts">
                            <Controls:GadgetMenuItem x:Name="mnuColumnChart" Header="Column chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.ColumnChartGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuLineChart" Header="Line chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.LineChartGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuAreaChart" Header="Area chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.AreaChartGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuPieChart" Header="Pie chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.PieChartGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuAberrationChart" Header="Aberration Detection chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.AberrationChartGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuParetoChart" Header="Pareto chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.ParetoChartGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuScatterChart" Header="Scatter chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.ScatterChartGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuHistogramChart" Header="Epi Curve chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.HistogramChartGadget" Click="mnuGadgetMenuItem_Click" />
                        </MenuItem>
                        <MenuItem x:Name="mnuAdvStats"  Header="Advanced Statistics">
                            <Controls:GadgetMenuItem x:Name="mnuLinear" Header="Linear Regression" IsEnabled="True" GadgetType="EpiDashboard.LinearRegressionControl" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuLogistic" Header="Logistic Regression" IsEnabled="True" GadgetType="EpiDashboard.LogisticRegressionControl" Click="mnuGadgetMenuItem_Click" />
                            <MenuItem x:Name="mnuCox" Header="Cox Proportional Hazards" IsEnabled="False" Visibility="Collapsed"/>
                            <MenuItem x:Name="mnuKM" Header="Kaplan Meier Survival" IsEnabled="False" Visibility="Collapsed"/>
                            <Controls:GadgetMenuItem x:Name="mnuCSFrequency" Header="Complex Sample Frequencies" IsEnabled="True" GadgetType="EpiDashboard.ComplexSampleFrequencyControl" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuCSMeans" Header="Complex Sample Means" IsEnabled="True" GadgetType="EpiDashboard.ComplexSampleMeansControl" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuCSTables" Header="Complex Sample Tables" IsEnabled="True" GadgetType="EpiDashboard.ComplexSampleTablesControl" Click="mnuGadgetMenuItem_Click" />
                        </MenuItem>
                        <MenuItem x:Name="mnuCustomGadgets"  Header="Custom gadgets" />
                    </MenuItem>
                    <MenuItem>
                        <MenuItem.Header>
                            <TextBlock x:Name="tblockAddStatCalcGadget">Add <Run FontWeight="Bold">StatCalc</Run> Calculator</TextBlock>
                        </MenuItem.Header>
                        <MenuItem x:Name="mnuStatCalc2x2" Header="Tables (2 x 2, 2 x n)"/>
                        <MenuItem x:Name="mnuSampleSizePower" Header="Sample size and power">
                            <Controls:GadgetMenuItem x:Name="mnuPopSurvey" Header="Population survey" GadgetType="EpiDashboard.Gadgets.StatCalc.PopulationSurveyGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuCohort" Header="Cohort or cross-sectional" GadgetType="EpiDashboard.Gadgets.StatCalc.CohortGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuUnmatched" Header="Unmatched case-control" GadgetType="EpiDashboard.Gadgets.StatCalc.UnmatchedCaseControlGadget" Click="mnuGadgetMenuItem_Click" />
                        </MenuItem>
                        <MenuItem x:Name="mnuChiSquare" Header="Chi square for trend"/>
                        <Controls:GadgetMenuItem x:Name="mnuPoisson" Header="Poisson (Rare event vs. std.)" GadgetType="EpiDashboard.Gadgets.StatCalc.PoissonGadget" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuBinomial" Header="Binomial (Proportion vs. std.)" GadgetType="EpiDashboard.Gadgets.StatCalc.BinomialGadget" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuMatchedPairCC" Header="Matched pair case control" GadgetType="EpiDashboard.Gadgets.StatCalc.MatchedPairCaseControlGadget" Click="mnuGadgetMenuItem_Click" />
                    </MenuItem>
                    <MenuItem x:Name="mnuGrowthCharts">
                        <MenuItem.Header>
                            <TextBlock x:Name="tblockAddNutStatChart">Add <Run FontWeight="Bold">NutStat</Run> Growth Chart</TextBlock>
                        </MenuItem.Header>
                        <MenuItem x:Name="mnuNutStatCDCRecommended" Header="CDC Recommended Growth References" Visibility="Collapsed">
                            <MenuItem x:Name="mnuCDCRecommendedBMI" Header="Body mass index (BMI) for age"/>
                            <MenuItem x:Name="mnuCDCRecommendedHA" Header="Height for age"/>
                            <MenuItem x:Name="mnuCDCRecommendedHCA" Header="Head circumference for age"/>
                            <MenuItem x:Name="mnuCDCRecommendedLA" Header="Length for age"/>
                            <MenuItem x:Name="mnuCDCRecommendedWA" Header="Weight for age"/>
                            <MenuItem x:Name="mnuCDCRecommendedWH" Header="Weight for height"/>
                            <MenuItem x:Name="mnuCDCRecommendedWL" Header="Weight for length"/>
                        </MenuItem>
                        <MenuItem x:Name="mnuNutStatCDC2000" Header="CDC 2000 Growth Reference">
                            <MenuItem x:Name="mnuCDC2000BMI" Header="Body mass index (BMI) for age"/>
                            <MenuItem x:Name="mnuCDC2000HA" Header="Height for age"/>
                            <MenuItem x:Name="mnuCDC2000HCA" Header="Head circumference for age"/>
                            <MenuItem x:Name="mnuCDC2000LA" Header="Length for age"/>
                            <MenuItem x:Name="mnuCDC2000WA" Header="Weight for age"/>
                            <MenuItem x:Name="mnuCDC2000WH" Header="Weight for height"/>
                            <MenuItem x:Name="mnuCDC2000WL" Header="Weight for length"/>
                        </MenuItem>
                        <MenuItem x:Name="mnuNutStatWHOCGS" Header="WHO Child Growth Standards">
                            <MenuItem x:Name="mnuWHOCGSBMI" Header="Body mass index (BMI) for age"/>
                            <MenuItem x:Name="mnuWHOCGSHA" Header="Height for age"/>
                            <MenuItem x:Name="mnuWHOCGSHCA" Header="Head circumference for age"/>
                            <MenuItem x:Name="mnuWHOCGSMUACA" Header="Arm circumference for age"/>
                            <MenuItem x:Name="mnuWHOCGSLA" Header="Length for age"/>
                            <MenuItem x:Name="mnuWHOCGSWA" Header="Weight for age"/>
                            <MenuItem x:Name="mnuWHOCGSWH" Header="Weight for height"/>
                            <MenuItem x:Name="mnuWHOCGSWL" Header="Weight for length"/>
                        </MenuItem>
                        <MenuItem x:Name="mnuNutStatWHO2007" Header="WHO Reference 2007">
                            <MenuItem x:Name="mnuWHO2007BMI" Header="Body mass index (BMI) for age"/>
                            <MenuItem x:Name="mnuWHO2007HA" Header="Height for age"/>
                            <MenuItem x:Name="mnuWHO2007WA" Header="Weight for age"/>
                        </MenuItem>
                        <MenuItem x:Name="mnuNutStatWHO1978" Header="CDC/WHO 1978">
                            <MenuItem x:Name="mnuWHO1978HA" Header="Height for age"/>
                            <MenuItem x:Name="mnuWHO1978LA" Header="Length for age"/>
                            <MenuItem x:Name="mnuWHO1978WA" Header="Weight for age"/>
                            <MenuItem x:Name="mnuWHO1978WH" Header="Weight for height"/>
                            <MenuItem x:Name="mnuWHO1978WL" Header="Weight for length"/>
                        </MenuItem>
                    </MenuItem>

                    <MenuItem>
                        <MenuItem.Header>
                            <TextBlock x:Name="tblockAddReportGadget">Add Report Gadget</TextBlock>
                        </MenuItem.Header>
                        <MenuItem x:Name="mnuStandardTextBox" Header="Simple text box"/>
                        <MenuItem x:Name="mnuStandardImageBox" Header="Image box"/>
                    </MenuItem>
                    <Separator/>
                    <MenuItem x:Name="mnuDataDictionary" Header="Show data dictionary" IsEnabled="False" />
                    <MenuItem x:Name="mnuProperties" Header="Canvas properties" IsEnabled="False" />
                    <MenuItem x:Name="mnuAutoArrange" Header="Auto-arrange gadgets" IsEnabled="False" />
                    <MenuItem x:Name="mnuRefresh" Header="Refresh data source" IsEnabled="False">
                        <MenuItem.Icon>
                            <Image Source="Images/refresh1.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem x:Name="mnuReset" Header="Reset Dashboard" IsEnabled="False"/>
                </ContextMenu>
            </ScrollViewer.ContextMenu>

            
            <dashboard:DragCanvas x:Name="canvasMain" AllowDragging="True" AllowDragOutOfView="True" Width="Auto" Height="8000">
                <dashboard:DragCanvas.LayoutTransform >
                    <ScaleTransform x:Name="m_canvasTransform"/>
                </dashboard:DragCanvas.LayoutTransform >

                <Line x:Name="anchorLine" Stroke="Red" StrokeThickness="2" Visibility="Collapsed" />
                
                <StackPanel x:Name="spTitle" Visibility="Collapsed" dashboard:DragCanvas.CanBeDragged="False" Canvas.Top="100" Width="400">
                    <dashboard:WaitCursor x:Name="waitCursor" Width="25" Height="25" Visibility="Hidden" StackPanel.ZIndex="99" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0, 50, 0, 0"/>
                    <TextBlock x:Name="tblockDashboardTitle" HorizontalAlignment="Center" Text="Dashboard" Margin="0,12,0,0" FontSize="14" FontWeight="Bold"></TextBlock>
                    <TextBlock x:Name="tblockInstructions" TextAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Center" Text="Right-click on canvas to add content." Margin="0,10,0,0" FontSize="12"></TextBlock>
                    <ProgressBar x:Name="progressBar" Height="18" Margin="4, 12, 4, 8" Visibility="Collapsed" MaxWidth="150" Width="150" HorizontalAlignment="Center" />
                </StackPanel>

                <Controls:InstructionsPanel x:Name="instructionsPanel" Canvas.Top="90" Canvas.Left="100" dashboard:DragCanvas.CanBeDragged="False" Visibility="Hidden" ></Controls:InstructionsPanel>
                <Controls:LoadingPanel x:Name="loadingPanel" Canvas.Top="90" Canvas.Left="200" dashboard:DragCanvas.CanBeDragged="False" Visibility="Hidden" Panel.ZIndex="6000"></Controls:LoadingPanel>               
                
                <DockPanel x:Name="introPanel" Canvas.Top="40" Canvas.Left="300" Width="450" Height="Auto" dashboard:DragCanvas.CanBeDragged="False">
                    <Grid>
                        <Rectangle Style="{DynamicResource shadowRectangle}"></Rectangle>
                        <Grid Background="#5EA8DE">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"></RowDefinition>
                                <RowDefinition></RowDefinition>
                                <RowDefinition Height="42"></RowDefinition>
                                <RowDefinition Height="9"></RowDefinition>
                            </Grid.RowDefinitions>
                            
                            <DockPanel>
                                <TextBlock x:Name="tblockIntroPanelTitle"  FontWeight="Light" Margin="16" FontSize="32" Foreground="White">Epi Info 7 Dashboard</TextBlock>
                            </DockPanel>

                            <DockPanel Grid.Row="1">
                                <TextBlock x:Name="tblockIntroText" FontWeight="Light" Margin="16" FontSize="18" TextWrapping="Wrap" Foreground="White">Right-click on the canvas to set a data source and add statistical gadgets. Or, open an existing dashboard canvas.</TextBlock>
                            </DockPanel>
                            
                            <Grid Grid.Row="2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="42"></ColumnDefinition>
                                    <ColumnDefinition Width="12"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock x:Name="tblockSetDataSourceNow" Grid.Column="0" FontWeight="Light" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0, 10, 25, 10" FontSize="14" Foreground="White" MouseEnter="introArrowSetDataSource_MouseEnter" MouseLeave="introArrowSetDataSource_MouseLeave" MouseLeftButtonUp="introArrowSetDataSource_MouseLeftButtonUp">Set a data source now</TextBlock>
                                
                                <DockPanel x:Name="introArrowSetDataSource" Grid.Column="1" Background="Transparent" MouseEnter="introArrowSetDataSource_MouseEnter" MouseLeave="introArrowSetDataSource_MouseLeave" MouseLeftButtonUp="introArrowSetDataSource_MouseLeftButtonUp">
                                        <Path Fill="White" HorizontalAlignment="Center" VerticalAlignment="Center">
                                            <Path.Data>
                                            <PathGeometry x:Name="introArrowIcon" FillRule="Nonzero" Figures="M7.34519958496094,1.19209289550781E-07L13.9831199645996,0.0134401321411133 24,10.043999671936 13.9831199645996,20.0738391876221 7.35888004302979,20.0738391876221 14.9851198196411,12.4478397369385 0,12.4478397369385 0,7.58663988113403 14.9311199188232,7.58663988113403 7.34519958496094,1.19209289550781E-07z" />
                                            </Path.Data>
                                        </Path>                                    
                                </DockPanel>
                                
                                <Ellipse Grid.Column="1" Stroke="White" StrokeThickness="2" ></Ellipse>
                                
                            </Grid>
                            
                        </Grid>
                    </Grid>
                </DockPanel>

                <StackPanel Canvas.Bottom="40" Visibility="Collapsed" Canvas.Right="40" dashboard:DragCanvas.CanBeDragged="False" x:Name="panelAddSpace" MouseEnter="panelAddSpace_MouseEnter" MouseLeave="panelAddSpace_MouseLeave" MouseLeftButtonDown="panelAddSpace_MouseLeftButtonDown" MouseLeftButtonUp="panelAddSpace_MouseLeftButtonUp">
                    <StackPanel.ToolTip>
                        <ToolTip>
                            <TextBlock>Add more space to this canvas</TextBlock>
                        </ToolTip>
                    </StackPanel.ToolTip>
                    <Grid>
                        <Rectangle Style="{DynamicResource shadowRectangle}"></Rectangle>
                        <Border Style="{DynamicResource mainGadgetBorder}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>

                                <TextBlock Grid.Row="0" FontWeight="Light" FontSize="15" Foreground="DarkSlateGray" Margin="4">Add space</TextBlock>
                                <Path HorizontalAlignment="Center" Grid.Row="1" x:Name="pathAddSpace"
                              Margin="4, 4, 4, 8"
                              Fill="Gray"
                                  StrokeThickness="1"
                                  Stroke="DarkSlateGray"
                              Data="M 15 30 L 30 0 0 0 Z" IsHitTestVisible="False" VerticalAlignment="Center" />
                            </Grid>
                        </Border>
                    </Grid>                
                </StackPanel>

                <DockPanel x:Name="introAvailableData" Canvas.Top="280" Canvas.Left="300" Width="550" Height="Auto" Visibility="Collapsed" dashboard:DragCanvas.CanBeDragged="True">
                    <Border Style="{DynamicResource mainGadgetBorder}">
                    <Grid>                        
                        <Rectangle Style="{DynamicResource shadowRectangle}"></Rectangle>
                        
                            <Path x:Name="pathDataTriangle" Visibility="Collapsed" ClipToBounds="False"
                              Margin="22,-28,0,0"
                                  StrokeThickness="1"
                                  Stroke="{DynamicResource gadgetBorderBrush}"
                              Data="M 15 9 L 30 30 0 30 Z" Fill="{DynamicResource gadgetBorderBackgroundBrush}" IsHitTestVisible="False" HorizontalAlignment="Left" VerticalAlignment="Top" />
                        
                            <Grid Background="{DynamicResource gadgetBorderBackgroundBrush}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"></RowDefinition>
                                <RowDefinition></RowDefinition>
                                <RowDefinition Height="Auto"></RowDefinition>
                                <RowDefinition Height="9"></RowDefinition>
                                <RowDefinition Height="Auto"></RowDefinition>
                                <RowDefinition Height="9"></RowDefinition>
                            </Grid.RowDefinitions>

                            <DockPanel>
                                <TextBlock x:Name="tblockCanvasFiles" FontWeight="Light" Margin="10, 10, 10, 0" FontSize="22" Foreground="DarkSlateGray">Quick Access - Available Canvas Files</TextBlock>
                            </DockPanel>
                            
                            <DockPanel Grid.Row="4">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="24"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="24"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                        <TextBlock FontSize="14" Foreground="DarkSlateGray" x:Name="tblockFindMoreCanvasFiles" Margin="10, 3, 5, 5"  MouseEnter="introArrowFindMore_MouseEnter" MouseLeave="introArrowFindMore_MouseLeave" MouseLeftButtonUp="introArrowFindMore_MouseLeftButtonUp">Browse...</TextBlock>

                                    <DockPanel x:Name="introArrowFindMore" Grid.Column="1" Background="Transparent" MouseEnter="introArrowFindMore_MouseEnter" MouseLeave="introArrowFindMore_MouseLeave" MouseLeftButtonUp="introArrowFindMore_MouseLeftButtonUp">
                                        <Path Fill="Black" HorizontalAlignment="Center" VerticalAlignment="Center">
                                            <Path.Data>
                                                    <PathGeometry x:Name="introArrowIconFindMore" FillRule="Nonzero" Figures="M3.97864985466003,5.96046447753906E-08L7.57418966293335,0.00728006660938263 13,5.44049978256226 7.57418966293335,10.8733291625977 3.98606014251709,10.8733291625977 8.11693954467773,6.7425799369812 0,6.7425799369812 0,4.10942983627319 8.08769035339355,4.10942983627319 3.97864985466003,5.96046447753906E-08z" />
                                            </Path.Data>
                                        </Path>
                                    </DockPanel>

                                    <Ellipse Grid.Column="1" Stroke="Black" StrokeThickness="1" ></Ellipse>
                                    
                                </Grid>                                
                            </DockPanel>

                            <Line Grid.Row="1" X1="10" Y1="10" X2="1540" Y2="10" Stroke="Gray" StrokeDashArray="1, 4" StrokeThickness="1" />
                            <ScrollViewer x:Name="svAvailableCanvasFiles" MaxHeight="504" Grid.Row="2">
                            <Grid x:Name="grdRecentDataSources" Margin="5">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="32"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <Grid.RowDefinitions>
                                    <!--<RowDefinition></RowDefinition>
                                    <RowDefinition></RowDefinition>-->
                                </Grid.RowDefinitions>
                                <!--<Image Source="Images/icon_file_generic_large.png" Width="25" Height="31" Grid.Row="0" Grid.RowSpan="2" Grid.Column="0"></Image>-->
                                <!--<TextBlock Grid.Row="0" Grid.Column="1">EColi.prj</TextBlock>
                                <TextBlock Grid.Row="1" Grid.Column="1" Foreground="Gray">C:\TFSCode\Epi Info 7\Projects\EColi</TextBlock>-->
                            </Grid>
                            </ScrollViewer>
                        </Grid>
                    </Grid>
                    </Border>
                </DockPanel>

            </dashboard:DragCanvas>
            
        </ScrollViewer>

        <DockPanel Grid.Row="4" Background="#9CAAC1">
        </DockPanel>

        <DockPanel Grid.Row="5" Background="#F7FAFC">
        </DockPanel>
        
        <DockPanel Grid.Row="6" x:Name="dockPanelBottom" >
            <DockPanel.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <GradientStop Color="#B7BCC1" Offset="1"></GradientStop>
                    <GradientStop Color="#E6EAEE" Offset="0"></GradientStop>
                </LinearGradientBrush>
            </DockPanel.Background>

            <DockPanel.Resources>
                <Style x:Key="statusStripStyle" TargetType="{x:Type TextBlock}">
                    <Setter Property="Margin" Value="3" />
                    <Setter Property="FontSize" Value="11" />
                </Style>
            </DockPanel.Resources>

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width=".3*"></ColumnDefinition>
                    <ColumnDefinition Width=".3*"></ColumnDefinition>
                    <ColumnDefinition MaxWidth="45" Width=".05*"></ColumnDefinition>
                    <ColumnDefinition MaxWidth="25" Width=".05*"></ColumnDefinition>                    
                    <ColumnDefinition MaxWidth="140" Width=".1*"></ColumnDefinition>
                    <ColumnDefinition MaxWidth="25" Width=".05*"></ColumnDefinition>
                    <ColumnDefinition Width="3"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock x:Name="tblockGadgetCount" FontFamily="Global User Interface" Style="{DynamicResource statusStripStyle}" Foreground="{DynamicResource textDarkGray}" Text="0 Gadgets">
                    <TextBlock.ToolTip>
                        <ToolTip x:Name="tooltipGadgets">
                          <DockPanel>                            
                            <TextBlock x:Name="tblockGadgetsDescription"></TextBlock>
                          </DockPanel>
                        </ToolTip>
                      </TextBlock.ToolTip>
                </TextBlock>                

                <Border Grid.Column="1" BorderBrush="#9CAAC1" BorderThickness="1,0,0,0">
                    <StackPanel Height="Auto" Width="1"></StackPanel>
                </Border>

                <TextBlock x:Name="tblockFieldCount" Visibility="Collapsed" Grid.Column="2"  FontFamily="Global User Interface" Style="{DynamicResource statusStripStyle}" Foreground="{DynamicResource textDarkGray}" Text="0 fields">                    
                </TextBlock>

                <!--<TextBlock x:Name="tblockCacheTime" Visibility="Collapsed" Grid.Column="3"  FontFamily="Global User Interface" Style="{DynamicResource statusStripStyle}" Foreground="{DynamicResource textDarkGray}" Text="Data set load time: 15 seconds">
                </TextBlock>-->

                <Grid Grid.Column="3" >
                    <DockPanel HorizontalAlignment="Right">
                        <Controls:StatusBarBordersButton x:Name="statusStripButtonShowBorders" Margin="1,0,1,0">
                            <Controls:StatusBarBordersButton.ToolTip>
                                <StackPanel>
                                    <Label FontWeight="Bold">Hide Gadget Borders Button</Label>
                                    <TextBlock
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Toggles the display of gadget borders and any buttons on the gadget's border.
                                    </TextBlock>
                                </StackPanel>
                            </Controls:StatusBarBordersButton.ToolTip>
                        </Controls:StatusBarBordersButton>
                        <Controls:StatusBarArrangeButton x:Name="statusStripButtonVerticalArrange" Margin="1,0,1,0">
                            <Controls:StatusBarArrangeButton.ToolTip>
                                <StackPanel>
                                    <Label FontWeight="Bold">Vertical Arrange Button</Label>
                                    <TextBlock
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Toggles a vertical stacking of gadgets. When gadgets are in vertical stack mode, they are automatically positioned and the user cannot re-position them.
                                    </TextBlock>
                                </StackPanel>
                                </Controls:StatusBarArrangeButton.ToolTip>
                        </Controls:StatusBarArrangeButton>
                    </DockPanel>
                </Grid>

                <TextBlock x:Name="tblockZoom" FontFamily="Global User Interface" Grid.Column="4" Style="{DynamicResource statusStripStyle}" Foreground="{DynamicResource textDarkGray}">100%</TextBlock>
                <Controls:CircularButton x:Name="buttonZoomOut" Height="16" Width="16" HasMinusSymbol="False" Grid.Column="5" MouseLeftButtonUp="buttonZoomOut_MouseLeftButtonUp"></Controls:CircularButton>
                <Controls:CircularButton x:Name="buttonZoomIn" Height="16" Width="16" HasMinusSymbol="True" Grid.Column="7" MouseLeftButtonUp="buttonZoomIn_MouseLeftButtonUp"></Controls:CircularButton>
                <Slider IsSnapToTickEnabled="True" Margin="0,0,0,0" TickFrequency="5" x:Name="sliderZoom" Grid.Column="6" Value="100" Minimum="50" Maximum="200" SmallChange="5" LargeChange="25" TickPlacement="BottomRight"  VerticalAlignment="Center" ValueChanged="sliderZoom_ValueChanged"></Slider>
            </Grid>

        </DockPanel>
    </Grid>
    
    
</UserControl>
